package org.myspringmvc.web.servlet;

import org.myspringmvc.ui.ModelMap;

/**
 * @ClassName: ModelAndView
 * @Author: YLY
 * @Description: 模型和视图对象
 * @Date: 2025/9/21
 * @Version: 1.0
 */
public class ModelAndView {

    private Object view;
    private ModelMap model;


    public ModelAndView() {
    }

    public ModelAndView(Object view, ModelMap model) {
        this.view = view;
        this.model = model;
    }

    /**
     * 获取
     * @return view
     */
    public Object getView() {
        return view;
    }

    /**
     * 设置
     * @param view
     */
    public void setView(Object view) {
        this.view = view;
    }

    /**
     * 获取
     * @return model
     */
    public ModelMap getModel() {
        return model;
    }

    /**
     * 设置
     * @param model
     */
    public void setModel(ModelMap model) {
        this.model = model;
    }

    public String toString() {
        return "ModelAndView{view = " + view + ", model = " + model + "}";
    }
}
